﻿using System.Configuration;
using GlobalOfficeTools.MVC3.Models;
using System.Linq;

namespace GlobalOfficeTools.MVC3.DomainServices.GeneralSystem
{
    public partial class SystemDomainService
    {
        #region Override Methods 
        protected override SystemEntities CreateObjectContext() 
        {
            string strConnectionString = string.Format("metadata=res://*/Models.SystemModel.csdl|res://*/Models.SystemModel.ssdl|res://*/Models.SystemModel.msl;provider=System.Data.SqlClient;provider connection string=\"{0}\"", ConfigurationManager.ConnectionStrings["GlobalOfficeToolsEntities"]);
            return new SystemEntities(strConnectionString);
        }
        #endregion

        #region Public Methods 
        public IQueryable<SYStblMenu> ListMenus()
        {
            return from x in this.ObjectContext.SYStblMenus
                   select x;
        }
        //public IQueryable<SYSvwUserState> ListUserStates()
        //{
        //    return from x in this.DbContext.SYSvwUserStates
        //           orderby x.UserStateId
        //           select x;
        //}
        #endregion
    }
}